package cn.huihuo.weibo.module;

import com.jfinal.plugin.activerecord.Model;
import com.jfinal.plugin.activerecord.Page;

/**
 * @author Dan
 * Created by zhengjunbo on 2015/10/12.
 */
public class WaterFall extends Model<WaterFall> {
    public static WaterFall waterFall = new WaterFall();

    public Page<WaterFall> findWaterFall(int pageNumber,int pageSize){
        return paginate(pageNumber,pageSize,"SELECT w.id wtId,pic.out_pic_path outPath,pic.inner_pic_path innerPath,p.sku_id skuId,pt.id commId,pt.product_comment comm,u.id userId,u.nickname nickname,u.avatar,p.price price,p.prod_title title,p.id prodId"," FROM waterfall w,prodcomment pt,productpic pic, USER u,product p WHERE w.prodCommId=pt.id AND pt.pic_id=pic.id AND u.id=pt.user_id and p.id=pt.prod_id order by w.hot desc");
    }
}
